package model.commands.booleans;

import java.util.List;
import model.Environment;
import model.SyntaxErrorException;
import model.commands.Command;


/**
 * Name:
 * NOT test 
 * 
 * Description:
 * returns 1 if test is 0 and 0 if test is non-zero
 * 
 * @author JLongley
 * @author Erick Gonzalez
 */
public class NotCommand extends Command {

    @Override
    public int evaluate(Environment e) throws SyntaxErrorException {
        List<Command> myArguments = getArguments();
        Command arg = myArguments.get(0);
        return arg.evaluate(e) == 0 ? 1 : 0;
    }
}
